
// <copyright file="DynamicStringTrimHelperTests.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   Class DynamicStringTrimHelperTests.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Tests.Reflection
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using SubhadraSolutions.Sharp.Utils.Reflection;
    using SubhadraSolutions.Sharp.Utils.Tests.DummyClasses;

    /// <summary>
    ///     Class DynamicStringTrimHelperTests.
    /// </summary>
    [TestClass]
    public class DynamicStringTrimHelperTests
    {
        #region Public Methods and Operators

        /// <summary>
        ///     Tests this instance.
        /// </summary>
        [TestMethod]
        public void Test()
        {
            Department1 d = Department1.BuildDummyDepartment1();
            foreach (Employee1 emp in d.Employees)
            {
                emp.FirstName = "  " + emp.FirstName + "   ";
                emp.LastName = "  " + emp.LastName + "   ";
            }

            DynamicStringTrimHelper<Employee1>.TrimStrings(d.Employees);

            foreach (Employee1 emp in d.Employees)
            {
                Assert.IsTrue(emp.FirstName == emp.FirstName.Trim());
                Assert.IsTrue(emp.LastName == emp.LastName.Trim());
            }
        }

        #endregion Public Methods and Operators
    }
}
